package export

import (
	"github.com/lab-online/internal/report/entity"
	"github.com/lab-online/internal/shared/valueobject"
)

func entityToVOMapper(report entity.ReportEntity) valueobject.ReportVO {
	return &valueobject.Report{
		ID:           report.GetID(),
		Content:      report.GetContent(),
		Score:        report.GetScore(),
		Status:       report.GetStatus(),
		Student:      report.GetStudent(),
		ClassID:      report.GetClassID(),
		ExperimentID: report.GetExperimentID(),
	}
}

func voTOEntityMapper(report valueobject.ReportVO) entity.ReportEntity {
	return entity.New(
		func(r *entity.Report) {
			r.ID = report.GetID()
			r.Content = report.GetContent()
			r.Score = report.GetScore()
			r.Status = report.GetStatus()
			r.Student = report.GetStudent()
			r.ClassID = report.GetClassID()
			r.ExperimentID = report.GetExperimentID()
		},
	)
}
